package com.sykj.cloud.system.api;

import com.sykj.cloud.common.core.constant.ServiceNameConstants;
import com.sykj.cloud.common.core.domain.R;
import com.sykj.cloud.common.core.web.domain.AjaxResult;
import com.sykj.cloud.system.api.domain.Member;
import com.sykj.cloud.system.api.factory.RemoteMemberFallbackFactory;
import com.sykj.cloud.system.api.model.LoginMember;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 会员服务
 *
 * @author ruoyi
 */
@FeignClient(contextId = "remoteMemberService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteMemberFallbackFactory.class)
public interface RemoteMemberService
{
    /**
     * 通过会员名查询会员信息
     *
     * @param loginname 会员名
     * @return 结果
     */
    @GetMapping(value = "/member/info/{loginname}")
    public R<LoginMember> getMemberInfo(@PathVariable("loginname") String loginname);

    /**
     * 通过会员名查询会员信息
     *
     * @return 结果
     */
    @GetMapping(value = "/member/add")
    public AjaxResult addHttp(@RequestBody Member member);
}
